package com.spring.controller;

import com.spring.config.SpringConfig.SpringConfig;
import com.spring.dao.BookDao;
import com.spring.dao.Impl.BookDaoImpl;
import com.spring.service.BookService;
import com.spring.service.Impl.BookServiceImpl;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;


/**
 * @author:CoolTiger
 * @description: TODO
 * @date:2024/04/24/23:29:45
 **/
public class AppForAnnotation {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(SpringConfig.class);
//        BookDao bookDao = (BookDaoImpl) ctx.getBean("bookDao");
//        System.out.println(bookDao);
        BookService bookService = (BookService) ctx.getBean("bookServiceImpl");
        bookService.save();
    }
}
